package lab02.test34;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * Created by 阿阿阿阿豪丶 on 2017/11/22.
 */
public class Test {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入单词：");

        String f = scanner.nextLine();

        String[] a = f.split(",");

        for (int i = 0; i < a.length; i++) {
            for (int j = i + 1; j < a.length; j++) {
                if (a[i].compareToIgnoreCase(a[j]) > 0) {
                    f = a[i];
                    a[i] = a[j];
                    a[j] = f;
                }
            }
        }
        System.out.println("max" + ":" + a[0]);
        System.out.println("min" + ":" + a[a.length - 1]);

        for (String fruits : a) {
            list.add(fruits);
            System.out.println(fruits);


        }
    }
}
